<?php
namespace app\servergoods\model;

use \app\manage\model\BaseModel;

/**
 * @author:      李颖
 * @DateTime:    2017-10-19 14:56:47
 * @Description: 账本
 */


class AccountBook extends BaseModel
{
	protected $name = 'account_book';
    protected $connection = 'db_config_goods';
    protected $dateFormat = 'Y-m-d';
    protected $isSettlementText = [0=>'未结算', 1=>'已结算'];
    protected $append = ['is_settlement_text'];

    public function getIsSettlementTextAttr($value, $data)
    {
    	return $this->isSettlementText[$data['is_settlement']];
    }

    public function setCreateUserInfoAttr($value, $data)
    {
        return json_encode($data['create_user_info']);
    }
   
    public function getCreateUserInfoAttr($value,$data)
    {
        return json_decode($data['create_user_info'], true);
    }
    public function setSignSettlementUserInfoAttr($value, $data)
    {
        return json_encode($data['sign_settlement_user_info']);
    }
   
    public function getSignSettlementUserInfoAttr($value,$data)
    {
        return json_decode($data['sign_settlement_user_info'], true);
    }




}